import java.util.Scanner;
/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86186
 * Date: 2023-07-21
 * Time: 6:49
 */
public class Main {
    public static void main1(String[] args) {
        Test test = new Test();
        String str1 = "nower";
        String str2 ="nowcoder";
        System.out.println(test.isSubsequence(str1, str2));
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
            String str = in.nextLine();
            StringBuilder stringBuilder = new StringBuilder();
            func1(str,stringBuilder);
            if(stringBuilder.length() == 0) {
                System.out.println(0);
            }
            System.out.println(stringBuilder);
        }

    private static void func1(String str,StringBuilder stringBuilder) {
        if(str.length() == 0) return;
        int slow = 0;
        int fast = 1;
        int prev = 0;
        int flg = 0;
        while(fast < str.length()) {
            if(str.charAt(slow) == str.charAt(fast)) {
                prev = slow;
                slow--;
                fast++;
                if(fast >= str.length()) break;
                if(slow < flg) {
                    slow = fast++;
                    flg += 2;
                }
            }else {
                slow++;
                fast++;
            }
        }
        if(slow < 0) return;
        if(prev < slow) {
            for(int i = slow; i < fast; i++) {
                stringBuilder.append(str.charAt(i));
            }
        }else {
            for(int i = slow-1; i < prev; i++) {
                stringBuilder.append(str.charAt(i));
            }
            for(int i = fast-1; i < str.length(); i++) {
                stringBuilder.append(str.charAt(i));
            }
        }
    }
}